﻿<script id='book-template' type="text/html">
    <li data-bind="attr: {class: classBinding}">
        <div class="dribbble">
            <div class="dribbble-shot">
                <div class="dribbble-img">
                    <a data-bind="attr: { href: '/books/details/'+ id}" class="dribbble-link">
                        <div style="text-align: center">
                            <img data-bind="attr: {src: coverImage,alt:title}"  width="200px" min-height="150px" /></div></a>
                    <a data-bind="attr: { href: '/books/details/'+ id}" class="dribbble-over"><strong>
                                                                                                  <span data-bind="text: title"></span></strong> 
                        <span data-bind="text: description" ></span>Uploaded: <span data-bind="text: uploadedDateString"></span></a>
                </div>
                <ul class="tools group">
                    <li class="fav"><span data-bind="text: numberOfLikes"></span></li>
                    <li class="cmnt"><span data-bind="text: numberOfComments"></span></li>
                    <li class="views"><span data-bind="text: numberOfViews"></span> </li>
                </ul>
            </div>
            <div class="extras">
            </div>
        </div>
        <h2>
            <a data-bind="attr: { href: '/Account/index/'+ uploadedBy}" class="url" rel="contact">
                <img alt="Screen shot 2011-03-07 at 10" class="photo fn" data-bind="attr: {src: uploaderImage}" />
                <span data-bind="text: uploader"></span></a>
        </h2>
    </li>
</script>
<script type="text/javascript">

    function Book(description, id, title, coverImage, numberOfPages, numberOfChapters, numberOfLikes, numberOfViews, numberOfComments, uploaderImage, uploader, uploadedBy, uploadedDateString, classBinding) {
        return {
            description: description,
            id: id,
            title: title,
            coverImage: coverImage,
            numberOfPages: numberOfPages,
            numberOfChapters: numberOfChapters,
            numberOfLikes: numberOfLikes,
            numberOfViews: numberOfViews,
            numberOfComments: numberOfComments,
            uploaderImage: uploaderImage,
            uploader: uploader,
            uploadedBy: uploadedBy,
            uploadedDateString: uploadedDateString,
            classBinding: classBinding,
            detail: function () {
                window.location = '/books/details/' + this.id;

            }
        };
    }
</script>